#!/bin/bash
#
# ParameterWeaver: a code generator to handle command line parameters
# and configuration files for C/C++/Fortran/R/Octave
# Copyright (C) 2013 Geert Jan Bex <geertjan.bex@uhasselt.be>
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

if [ -n "${VSC_INSTITUTE_LOCAL}" ]
then
    . /apps/leuven/etc/bash.bashrc
    module purge
    module load python/2.7.2_simple
fi

if [ -z "${WEAVER_DIR}" ]
then
    DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
    export WEAVER_DIR="${DIR}/.."
fi

if [ -z "${WEAVER_LIB}" ]
then
    export WEAVER_LIB="${WEAVER_DIR}/lib/parameter_weaver/python"
fi

if [ -z "${WEAVER_TMPL}" ]
then
    export WEAVER_TMPL="${WEAVER_DIR}/lib/parameter_weaver/tmpl"
fi

python ${WEAVER_LIB}/weave.py $*

